<!DOCTYPE HTML>
<html lang="zh-cn">

	<head>
		<base href="http://test.youxiduo.com/iweb/shixin_6/" />
		<!--<base href="http://resource.youxiduo.com/special/shihou/promoter/3233/" />-->
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="format-detection" content="telephone=no">
		<meta name="viewport" content="width=device-width,user-scalable=no">
		<title>新主播7天时薪奖励计划</title>
		<meta name="keywords" content="狮吼,狮吼直播,手游直播,双投屏直播" />
		<meta name="description" content="狮吼 - 4亿手游玩家的直播平台、狮吼是游戏多旗下手游直播平台，支持双投屏直播的移动端平台，边玩边播，分享快乐！狮吼直播，随时随地录屏直播，语音弹幕独特玩法，各路主播游戏大神齐聚；电竞赛事、综艺娱乐、户外精彩，一切改变尽在 狮吼- 4亿手游玩家的直播平台。" />
		<link rel="stylesheet" href="static/css/base.css" />
		<link rel="stylesheet" href="static/css/style.css" />
		<script src="static/js/jquery-1.7.1.min.js"></script>
		<script type="text/javascript" src="static/js/util.js"></script>
		<script type="text/javascript" src="static/js/config.js"></script>
		<script>
			var plan_Id;
			var share_conf_id;
			var signed;
			var from_user_id;
			var deviceId;
			var page;
			var util;
			var config;
			$(function() {
				util = new Util();
				config = new Config();
				plan_Id = util.getUrlParam('plan_Id');
				share_conf_id = util.getUrlParam('share_config_id');
				signed = util.getUrlParam('signed');
				from_user_id = util.getUrlParam('from_user_id');
				deviceId = util.getUrlParam('deviceId');
				page = util.getUrlParam("page");
				$('.btnd').click(function() {
					if(page == 1){
						$('.btnd').attr('href', 'http://www.shihou.tv/app').click();
					}else{
						if(from_user_id == "0") {
							$(".pop").fadeIn(200);
							setTimeout('$(".pop").hide()', time * 1000);
						} else {
							//如果报过名
							if("1" == signed) {
								skipIndex();
							}else{
								signUp(); //报名操作	
							}
						}
					}
				});
			}); //报名操作
			function signUp() {
				$.ajax({
					url: config.baseUrl + "/ajax_sign_up",
					type: 'GET',
					async: false,
					dataType: "jsonp",
					jsonp: "callback", //服务端用于接收callback调用的function名的参数(请使用callback或jsonp)
					jsonpCallback: "success_jsonpCallback", //callback的function名称
					data: {
						'from_user_id': from_user_id,
						"share_conf_id": '3233',
						"deviceId":deviceId
					},
					success: function(data) {
						console.log(JSON.stringify(data));
						if(0 == data.errorCode) { //报名成功
							$("#sign_up_success").fadeIn(200);
							setTimeout('$("#sign_up_success").hide()', 1500);
							skipIndex();
						} else { //报名失败
							$("#sign_up_error").html(data.errorDescription);
							$("#sign_up_error").fadeIn(200);
							setTimeout('$("#sign_up_error").hide()', 3000);
						}
					}
				});
			}
			
			function skipIndex(){
				var params = util.getUrlParams();
				params = params.replace('page=1', 'page=0');
				console.log(config.activityUrl+params);
				window.location.href = config.activityUrl+params;
			}
		</script>
		<style>
			body {
				background: url(static/img/bodyBg.jpg) repeat-y;
				width: 100%;
				background-size: 100%;
			}
		</style>
	</head>

	<body>
		<div class="detailW">
			<img src="static/img/dbg1.jpg" />
			<img src="static/img/dbg2.jpg" />
			<div class="boxImg">
				<img src="static/img/dbg3.jpg" />
				<a class="btnd"><img src="static/img/djbm.png" /></a>
			</div>
			<!-- 登录 -->
			<div class="pop">请登录后再来参加活动吧~</div>
			<div id="sign_up_success" class="pop">报名成功</div>
			<div id="sign_up_error" class="pop">报名失败,请重试</div>
			<div id="login_error" class="pop">请登录后，再点击报名</div>
		</div>
	</body>

</html>